package org.itboys.mobile.service.mongo.weixin.house;

import org.itboys.mdl.conmon.Finals;
import org.itboys.mdl.entity.mongo.house.MdlHouse;
import org.itboys.mongodb.core.MongoDataSource;
import org.itboys.mongodb.service.BaseMongoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 作者：zzq
 * 时间：2017/12/1
 * 描述：迈迪龙_微信_户型
 */
@Service
public class MdlWeixinHouseService extends BaseMongoService<MdlHouse>{
    @Resource(name = "mdlDs")
    private MongoDataSource mdlDataSource;
    @Override
    protected MongoDataSource getMongoDataSource() {
        return mdlDataSource;
    }

    @Override
    protected Class<MdlHouse> getEntityClass() {
        return MdlHouse.class;
    }

    /**
     * 查询
     * @param isIndexRecommend
     * @return
     */
    public List<MdlHouse> selectHouse(Integer isIndexRecommend){
        Map<String ,Object> param=new HashMap<String,Object>();
        param.put("isDeleted", Finals.NO);
        if(isIndexRecommend!=null){
            param.put("isIndexRecommend",1);
        }
        return super.list(param);
    }


}
